﻿Imports System.Data.OleDb
Public Class myRecipe
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Try
            If String.IsNullOrEmpty(Session("UserId")) Or String.IsNullOrWhiteSpace(Session("UserId")) Then
                ''Session.RemoveAll()
                Response.Redirect("Login.aspx", False)
            Else
                Dim objBl = New BL()
                ''Dim objDal = New DL()

                Dim dbconn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=" & Server.MapPath("/App_Data/KitchenCompition.mdb"))
                Dim strSelect As String = "select * from reciepe where UserId=" & Session("UserId")
                gvRecipe.DataSource = objBl.GetDataAccess(strSelect, dbconn)
                gvRecipe.DataBind()

            End If
        Catch ex As Exception
            Response.Redirect("Login.aspx")
        End Try


    End Sub

End Class